#include "logicpool.h"

WARLOCK_NS_BEGIN

LogicPool::LogicPool(std::initializer_list<bool> bools)
{
  for (auto x : bools) {
    if (x) m_has_t = true;
    else m_has_f = true;
  }
}

bool LogicPool::anyRight() const
{
  return m_has_t;
}

bool LogicPool::anyWrong() const
{
  return  m_has_f;
}

bool LogicPool::allWrong() const
{
  return (! m_has_t) && m_has_f;
}

bool LogicPool::allRight() const
{
  return m_has_t && (! m_has_f);
}

void LogicPool::add(bool value)
{
  if (value)
    m_has_t = true;
  else
    m_has_f = true;
}

void LogicPool::add(std::initializer_list<bool> values)
{
  for (auto x : values)
    add(x);
}

WARLOCK_NS_END

